<?php
ob_start();

//错误显示
ini_set('display_errors', 1);
error_reporting(E_ALL);

require_once('cls_page.php');
require_once('du_system.php');

$test = new Page();
$test->_page 		= isset($_GET['p'])?$_GET['p']:1;
$test->_pageUrl 	= ''; 
$test->_tableName 	= 'articles';
$test->SetPageSize(7);
$test->SetSelectSql('SELECT id,title, date, text FROM articles ORDER BY id DESC ');
$test->SetItem('id!$!标题!$!text!$!date');
$test->SetItemField('id!$!title!$!text!$!date');
#前
$test->SetPrefix('<div class="wrdLatest"><div class="xtop"><div class="xb1"></div><div class="xb2"></div><div class="xb3"></div><div class="xb4"></div></div><div class="xboxcontent">');
$test->SetSuffix('</div><div class="xbottom"><div class="xb4"></div><div class="xb3"></div><div class="xb2"></div><div class="xb1"></div></div></div>');
$test->SetLooofix('<a id="a#0#", class="title" href="?id=#0#">,#1#</a>,<p id="p#0#" class="content" , >#2#<p>,<cite>---#3#<cite>');

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<title>duphp_demo</title>
</head>
<body bgcolor="#cccccc">
<div class="main">
	<h2><a href="http://www.xydudu.cn/duphp">DUPHP<span>beta 1.0</span></a></h2>
	<?php $test->ShowList('%s'); ?>
	<div class="inputdiv"><div class="inbox"><?php Input('demo.php');?></div></div>
</div>
</body>
</html>
<script>
$(document).ready(function(){	xue.init();});
var xue = function(){
	function showP(){$(this).css("color","#cccccc");$("#"+this.id.replace("a","p")).fadeIn("slow");return false;}
	function hideP(){$(this).css("color","#000");$("#"+this.id.replace("a","p")).fadeOut("slow");return false;}
	return{init:function(){$("p.content").hide();$("a.title").toggle(showP,hideP).focus(function(){ this.blur();});}}
}();

</script>
